<?php 

class File {
    public static function exists($file) {
        return file_exists(self::path($file));
    }
	
	public static function path($path, $absolute = false) {
		if (strpos($path, MITHOS) === false && !preg_match('(^[a-z]+:)i', $path, $out)) {
			if ($absolute) {
                $path = MITHOS . DS . $path;
			}
		}
        $pattern = '(([^:])[/\\\]+|\\\)';
        return preg_replace($pattern, '$1/', $path);
    }

    public static function extension($file, $extension) {
        if (strpos($file, '?') === false) {
            if (strpos($file, '.' . $extension) === false) {
                $file .= '.' . $extension;
            }
        }
        return $file;
    }
}

?>